A knowledge of the composition of planets, satellites, and asteroids is of primary importance in understanding the formation and evolution of the solar system. Gamma-ray spectroscopy is capable of measuring the composition of meter-depth surface material from orbit around any body possessing little or no atmosphere. Measurement sensitivity is determined by detector efficiency and resolution, counting time, and the background flux while the effective spatial resolution depends upon the field-of-view and counting time together with the regional contrast in composition. The advantages of using germanium as a detector of gamma rays in space are illustrated experimentally and a compact instrument cooled by passive thermal radiation is described. Calculations of the expected sensitivity of this instrument at the Moon and Mars show that at least a dozen elements will be detected, twice the number which have been isolated in the Apollo gamma-ray data.